home *** CD-ROM | disk | FTP | other *** search
/ Gekkan Dennou Club 145 / Gekkan Dennou Club - 2000.6 Vol. 145 (Japan).7z / Gekkan Dennou Club - 2000.6 Vol. 145 (Japan) (Track 1).bin / tools / sharp / xc2102.lzh / INCLUDE / STDIO.H < prev    next >
Text File  |  1992-03-03  |  4KB  |  205 lines

  1. /*
  2.  * stdio.h X68k XC Compiler v2.10 Copyright 1990,91,92 SHARP/Hudson
  3.  */
  4. #ifndef    __STDIO_H
  5. #define    __STDIO_H
  6.  
  7. #include    <stddef.h>
  8. #include    <stdarg.h>
  9. #include    <fcntl.h>
  10.  
  11. #ifdef    FORWORD
  12. #define    __PROTO_TYPE
  13. #endif
  14. #ifdef    __STDC__
  15. #define    __PROTO_TYPE
  16. #endif
  17.  
  18. #ifndef    BUFSIZ
  19. #define    BUFSIZ    1024
  20. #endif
  21. #ifndef    _NFILE
  22. #define    _NFILE    40
  23. #endif
  24. #ifndef    FOPEN_MAX
  25. #define    FOPEN_MAX    40
  26. #endif
  27. /* CLIB.L を変更しなければ意味がありません */
  28.  
  29. #define    TMP_MAX    65535
  30. #define    L_tmpnam    128
  31. #define    FILENAME_MAX    128
  32. /* CLIB.L で固定の値として使用しています
  33.  * 変更したり、別な値を再定義してはいけません */
  34.  
  35. typedef    struct    _iobuf    {
  36.     char    *_ptr;
  37.     int    _cnt;
  38.     char    *_base;
  39.     int    _flag;
  40.     int    _bsize;
  41.     char    _file;
  42.     char    _pback;
  43.     char    *_fname;
  44. }    FILE;
  45. extern    FILE    _iob[_NFILE];
  46. extern    unsigned    _liobuf[96];
  47.  
  48. #define    stdin    (&_iob[0])
  49. #define    stdout    (&_iob[1])
  50. #define    stderr    (&_iob[2])
  51. #define    stdaux    (&_iob[3])
  52. #define    stdprn    (&_iob[4])
  53.  
  54. #define    _IOFBF        0x00
  55. #define    _IOREAD        0x01
  56. #define    _IOWRT        0x02
  57. #define    _IORW        0x100
  58. #define    _IONBF        0x08
  59. #define    _IOMYBUF    0x10
  60. #define    _IOEOF        0x20
  61. #define    _IOERR        0x40
  62. #define    _IOLBF        0x80
  63.  
  64. #ifdef    MACRO
  65.     #define getc(f) (--(f)->_cnt >= 0 ? 0xff & *(f)->_ptr++ : _filbuf(f))
  66.     #define putc(c,f) (--(f)->_cnt >= 0 ? 0xff & (*(f)->_ptr++ = (c)) : _flsbuf((c),(f)))
  67.     #define getchar() getc(stdin)
  68.     #define putchar(c) putc((c),stdout)
  69.     #define feof(f) ((f)->_flag & _IOEOF)
  70.     #define ferror(f) ((f)->_flag & _IOERR)
  71.     #define fileno(f) ((f)->_file)
  72.     #define    clearerr(f) (((f)->_flag &= ~(_IOEOF+_IOERR)),(_liobuf[fileno(f)] &= ~O_EOF))
  73. #endif
  74.  
  75. #ifdef    __PROTO_TYPE
  76.  
  77. #ifndef    MACRO
  78. int    getc(FILE *);
  79. int    putc(int, FILE *);
  80. int    getchar(void);
  81. int    putchar(int);
  82. int    feof(FILE *);
  83. int    ferror(FILE *);
  84. int    fileno(FILE *);
  85. void    clearerr(FILE *);
  86. #endif
  87.  
  88. int    fclose(FILE *);
  89. int    fflush(FILE *);
  90. void    setbuf(FILE *, char *);
  91. int    fgetc(FILE *);
  92. char    *fgets(char *, int, FILE *);
  93. int    fputc(int, FILE *);
  94. char    *gets(char *);
  95. int    ungetc(int, FILE *);
  96. int    fseek(FILE *, long, int);
  97. long    ftell(FILE *);
  98. void    rewind(FILE *);
  99. int    fcloseall(void);
  100. int    flushall(void);
  101. int    fputchar(int);
  102. void    clrerr(FILE *);
  103. void    fmode(FILE *, int);
  104. int    getw(FILE *);
  105. int    fgetchar(void);
  106. int    getl(FILE *);
  107. int    putl(long, FILE *);
  108. int    putw(short, FILE *);
  109. void    setnbf(FILE *);
  110. FILE    *tmpfile(void);
  111. char    *tmpnam(char *);
  112. int    rmtmp(void);
  113. int    rmtemp(void);
  114. FILE    *fopen(const char *, const char *);
  115. FILE    *freopen(const char *, const char *, FILE *);
  116. int    setvbuf(FILE *, char *, int, size_t);
  117. int    fprintf(FILE *, const char *,...);
  118. int    vfprintf(FILE *, const char *, va_list);
  119. int    fscanf(FILE *, const char *,...);
  120. int    printf(const char *,...);
  121. int    vprintf(const char *, va_list);
  122. int    scanf(const char *,...);
  123. int    sprintf(char *, const char *,...);
  124. int    vsprintf(char *, const char *, va_list);
  125. int    sscanf(const char *, const char *,...);
  126. int    fputs(const char *, FILE *);
  127. int    puts(const char *);
  128. size_t    fread(void *, size_t, size_t, FILE *);
  129. size_t    fwrite(const void *, size_t, size_t, FILE *);
  130. void    perror(const char *);
  131. FILE    *fdopen(int, const char *);
  132. int    fgetpos(FILE *, fpos_t *);
  133. int    fsetpos(FILE *, const fpos_t *);
  134. int    remove(const char *);
  135. FILE    *tempfile(const char *,const char *);
  136. char    *tempnam(const char *,const char *);
  137.  
  138. #undef    __PROTO_TYPE
  139. #else
  140.  
  141. #ifndef    MACRO
  142. int    getc();
  143. int    putc();
  144. int    getchar();
  145. int    putchar();
  146. int    feof();
  147. int    ferror();
  148. int    fileno();
  149. void    clearerr();
  150. #endif
  151.  
  152. int    fclose();
  153. int    fflush();
  154. FILE    *fopen();
  155. FILE    *freopen();
  156. void    setbuf();
  157. int    setvbuf();
  158. int    fprintf();
  159. int    vfprintf();
  160. int    fscanf();
  161. int    printf();
  162. int    vprintf();
  163. int    scanf();
  164. int    sprintf();
  165. int    vsprintf();
  166. int    sscanf();
  167. int    fgetc();
  168. char    *fgets();
  169. int    fputc();
  170. int    fputs();
  171. char    *gets();
  172. int    puts();
  173. int    ungetc();
  174. int    fseek();
  175. long    ftell();
  176. void    rewind();
  177. void    perror();
  178. int    fcloseall();
  179. int    flushall();
  180. int    fputchar();
  181. void    clrerr();
  182. void    fmode();
  183. int    getw();
  184. int    fgetchar();
  185. int    getl();
  186. int    putl();
  187. int    putw();
  188. void    setnbf();
  189. FILE    *fdopen();
  190. int    fgetpos();
  191. int    fsetpos();
  192. int    remove();
  193. FILE    *tmpfile();
  194. FILE    *tempfile();
  195. char    *tmpnam();
  196. char    *tempnam();
  197. int    rmtmp();
  198. int    rmtemp();
  199. size_t    fread();
  200. size_t    fwrite();
  201.  
  202. #endif
  203.  
  204. #endif
  205.